<nav>
                <div class="menu-main-menu-container">
                	<ul class="menu">
                        <wk:arctype type='top' display='3,0' row='10' vo='a' field="id,fid,seotitle,keywords"> 
                            <current field='typeid'>
                            <li class="mymenu-icon-<field name='seotitle' fromvo='a'/><field name='keywords' fromvo='a'/> current-menu-parent <?php 
                                $id = $_field['id'];
                                $sql = "SELECT * FROM `".C('DB_PREFIX')."arctype` WHERE `id`='$id'";
                                $query = mysql_query($sql);
                                $row=mysql_fetch_array($query);
                                $sql2 = "SELECT * FROM `".C('DB_PREFIX')."arctype` WHERE `fid`='$id'";
                                $query2 = mysql_query($sql2);
                                $row2=mysql_fetch_array($query2);
                                //print_r($row2);
                                //echo $row['display'];
                                if (($row2['fid'] === $id) && ($row['display'] === "4")) {
                                    echo "menu-item-has-children";
                                } 
                                ?>">
                                    <a href="<field name='typeurl' fromvo='a'/>?mode=wap"><span><field name='typename' fromvo='a'/></span></a>
                                    <ul class="sub-menu">
                                        <wk:arctype typeid='~typeid~' row='10' field="id,fid,keywords,seotitle,description,sortrank" display='2,0'  vo='d' fromvo='a'>  
                                        <current field='typeid'>
                                        <li class="current-menu-item"><a href="<field name='typeurl'/>?mode=wap"><span><field name='typename'/></span></a></li>
                                        <else/>
                                        <li><a href="<field name='typeurl'/>?mode=wap"><span><field name='typename'/></span></a></li>
                                        </current>
                                        </wk:arctype>
                                    </ul>
                                 </li>
                            <else/>
                            <li class="mymenu-icon-<field name='seotitle' fromvo='a'/><field name='keywords' fromvo='a'/> menu-item-has-children">
                                    <a href="<field name='typeurl' fromvo='a'/>?mode=wap"><span><field name='typename' fromvo='a'/></span></a>
                                    <ul class="sub-menu">
                                        <wk:arctype typeid='~typeid~' row='10' field="id,fid,keywords,seotitle,description,sortrank" display='3,0'  vo='d' fromvo='a'>  
                                        <current field='typeid'>
                                        <li class="current-menu-item"><a href="<field name='typeurl'/>?mode=wap"><span><field name='typename'/></span></a></li>
                                        <else/>
                                        <li><a href="<field name='typeurl'/>?mode=wap"><span><field name='typename'/></span></a></li>
                                        </current>
                                        </wk:arctype>
                                    </ul>
                                 </li>
                            </current>
                        </wk:arctype>
                	</ul>
            	</div>
            </nav>